//-----------------------------------------------------------------------
// <copyright file="HoTroTrucTuyenServiceBase.cs" company="Pyramid Consulting">
//     Copyright (c) Pyramid Consulting. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using Pyco;
using Pyco.Diagnostics;
using Pyco.Data;
using APPro.Entities;
using APPro.Data;
    
namespace APPro.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class HoTroTrucTuyenServiceBase
    {
        #region HoTroTrucTuyenServiceBase

        public static void CreateHoTroTrucTuyen(HoTroTrucTuyen hoTroTrucTuyen)
        {            
            try
            {
                HoTroTrucTuyenDAO hoTroTrucTuyenDAO = new HoTroTrucTuyenDAO();
                hoTroTrucTuyenDAO.CreateHoTroTrucTuyen(hoTroTrucTuyen);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessCreateHoTroTrucTuyenException, ex);
            }
        }

        public static void UpdateHoTroTrucTuyen(HoTroTrucTuyen hoTroTrucTuyen)
        {            
            try
            {
                HoTroTrucTuyenDAO hoTroTrucTuyenDAO = new HoTroTrucTuyenDAO();
                hoTroTrucTuyenDAO.UpdateHoTroTrucTuyen(hoTroTrucTuyen);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessUpdateHoTroTrucTuyenException, ex);
            }
        }        

        public static void DeleteHoTroTrucTuyen(int maNguoiHoTro)
        {            
            try
            {
                HoTroTrucTuyenDAO hoTroTrucTuyenDAO = new HoTroTrucTuyenDAO();
                hoTroTrucTuyenDAO.DeleteHoTroTrucTuyen(maNguoiHoTro);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessDeleteHoTroTrucTuyenException, ex);
            }
        }
		
        public static HoTroTrucTuyen GetHoTroTrucTuyen(int maNguoiHoTro)
        {            
            try
            {
                HoTroTrucTuyenDAO hoTroTrucTuyenDAO = new HoTroTrucTuyenDAO();
                return hoTroTrucTuyenDAO.GetHoTroTrucTuyen(maNguoiHoTro);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetHoTroTrucTuyenException, ex);
            }
        }                
		
        public static HoTroTrucTuyenCollection GetHoTroTrucTuyenList(HoTroTrucTuyenColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                HoTroTrucTuyenDAO hoTroTrucTuyenDAO = new HoTroTrucTuyenDAO();
                return hoTroTrucTuyenDAO.GetHoTroTrucTuyenList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetHoTroTrucTuyenListException, ex);
            }
        }        

        public static HoTroTrucTuyenCollection GetHoTroTrucTuyenList(HoTroTrucTuyenColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                HoTroTrucTuyenDAO hoTroTrucTuyenDAO = new HoTroTrucTuyenDAO();
                return hoTroTrucTuyenDAO.GetHoTroTrucTuyenList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetHoTroTrucTuyenListException, ex);
            }
        }        
		
		
        #endregion
    }
}